package com.bwie.controller;

import com.bwie.pojo.Patient;
import com.bwie.service.PatientService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user/patient")
public class PatientController {

    @Autowired
    PatientService patientService;

    /**
     * 列表分页查询
     * @param pageInfoVo
     * @return
     */
    @PostMapping("getPatientPageList")
    public R getPatientPageList(@RequestBody PageInfoVo pageInfoVo){
        return patientService.getPatientPageList(pageInfoVo);
    }

    /**
     * 添加挂号
     * @param patient
     * @return
     */
    @PostMapping("addPatient")
    public R addPatient(@RequestBody Patient patient){
        return patientService.addPatient(patient);
    }

    /**
     * 修改信息
     * @param patient
     * @return
     */
    @PostMapping("updatePatient")
    public R updatePatient(@RequestBody Patient patient){
        return patientService.updatePatient(patient);
    }


}
